<%@ page language="java" contentType="text/html; charset=utf-8"
         pageEncoding="utf-8" isELIgnored="false" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html lang="en">
<head>
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" type="text/css" href="../statics/css/bootstrap.min.css">
    <title>标签列表</title>
    <script type="text/javascript" src="${pageContext.request.contextPath}/statics/js/jquery-1.8.3.min.js"></script>
    <script>
        $(function () {
            //修改class的属性，变色 使用过滤选择器实现了
         $("span[value='班级']").prop("class","label label-info");

        })
    </script>
</head>
<body>
<div class="container-fluid">
    <div class="row">
        <div class="col-sm-12">
            <input type="button" value="添加标签" class="btn btn-sm btn-info" onclick="location.href='addMark.jsp'"/>
        </div>
    </div>
    <div class="row" style="margin-top: 10px; ">
        <div class="col-sm-12">
            <table class="table table-hover table-bordered table-striped">
                <tr>
                    <th>编号</th>
                    <th>名称</th>
                    <th>创建时间</th>
                    <th>标签类型</th>
                    <th>操作</th>
                </tr>
                <c:forEach var="mark" items="${requestScope.marks}" varStatus="m">
                    <tr>
                        <td>${m.count}</td>
                        <td>${mark.mname}</td>
                        <td><fmt:formatDate value="${mark.mtime}"  pattern="yyyy年mm月dd日" ></fmt:formatDate></td>
                        <td>
                            <span class="label label-warning"  value="${mark.mtype}">${mark.mtype}</span>
                        </td>
                        <td><a href="${pageContext.request.contextPath}/mark/deleteMark?mark.mid=${mark.mid}" class="btn btn-danger btn-sm">删除</a></td>
                    </tr>
                </c:forEach>
            </table>
        </div>
    </div>

</div>


</body>
</html>